/**
 * Created by Dalyn on 2017/3/24.
 */
import Relay from "react-relay";

export default class ApplyPayOrderMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { applyPayOrder }`;
    }

    getVariables() {
        return {
            argsInput: {
                orderId: this.props.orderId,
                payment: this.props.payment,
                orderMoney: this.props.orderMoney,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on applyPayOrderPayload {
            data {
                errorCode
                value
                totalResult
                id
                orderId
                remainOrderMoney
                cashMoney
                debtOrderMoney
                orderMoney
                partBName
                partBUserName
                partBPhone
                loanInfoDomain{
                  canLoanMoney
                  dayRate
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on applyPayOrderPayload {
                    data {
                        errorCode
                        value
                        totalResult
                        id
                        orderId
                        remainOrderMoney
                        cashMoney
                        debtOrderMoney
                        orderMoney
                        partBName
                        partBUserName
                        partBPhone
                        loanInfoDomain{
                          canLoanMoney
                          dayRate
                        }
                    }
                }
            `]
        }];
    }

}
